<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('卡口信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 91px;">所属行政区划：</label>
                                <select name="xzqh" th:with="type=${@dict.getType('xzqhxzqh')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>卡口类型：</label>
                                <select name="bayonetType" th:with="type=${@dict.getType('bayonet_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>卡口名称：</label>
                                <input type="text" name="bayonetName"/>
                            </li>
                            <li>
                                <label>卡口状态：</label>
                                <select name="bayonetState" th:with="type=${@dict.getType('bayonet_state')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>


            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('bayonet:bayonet:edit')}]];
        var removeFlag = [[${@permission.hasPermi('bayonet:bayonet:remove')}]];
        var bayonetTypeDatas = [[${@dict.getType('bayonet_type')}]];
        var lanesDirDatas = [[${@dict.getType('lanes_dir')}]];
        var bayonetStateDatas = [[${@dict.getType('bayonet_state')}]];
        var xzqhxzqh = [[${@dict.getType('xzqhxzqh')}]];
        var prefix = ctx + "bayonet/bayonet";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "卡口信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'bayonetId',
                    title: '卡口信息ID',
                    visible: false
                },
                {
                    field: 'bayonetNum',
                    title: '卡口编号'
                },
                {
                    field: 'bayonetName',
                    title: '卡口名称'
                },
                {
                    field: 'xzqh',
                    title: '所属行政区划',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(xzqhxzqh, value);
                    }
                },
                {
                    field: 'bayonetType',
                    title: '卡口类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(bayonetTypeDatas, value);
                    }
                },
                {
                    field: 'lanesNum',
                    title: '车道数'
                },
                {
                    field: 'bayonetSuozaiNum',
                    title: '卡口所在地管辖派出所代码',
                    visible: false
                },
                {
                    field: 'bayonetSuozaiName',
                    title: '卡口所在地管辖派出所名称',
                    visible: false
                },
                {
                    field: 'lanesDir',
                    title: '车道方向',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(lanesDirDatas, value);
                    }
                },
                {
                    field: 'bayonetState',
                    title: '卡口状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(bayonetStateDatas, value);
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>